package com.xiaozhu.controller;

import com.xiaozhu.common.result.Result;
import com.xiaozhu.pojo.dto.UserDto;
import com.xiaozhu.pojo.vo.UserVo;
import com.xiaozhu.service.MapService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱慧军
 * @version 1.0
 */

@RestController
@RequestMapping("/map")
@Slf4j
public class MapController {

    @Autowired
    private MapService mapService;

    @GetMapping()
    public Result<UserVo> map(UserDto userDto) {
        UserVo userVo = mapService.distance(userDto);
        return Result.success(userVo);
    }
}
